import request from '@/utils/request'
/**
 * 新增部门
 * @param {codo ,introduce,manager,name,pid}data
 * @returns
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data// 请求体
  })
}
/**
 * 获取所有部门

 * @returns
 */
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'

  })
}
/**
 * 修改所有部门
 * *  * @param {codo ,introduce,manager,name,pid}data
 * @returns
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data// // 请求体

  })
}

/**
 * 删除指定部门

 * @returns
 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
    //

  })
}
/**
 * 获取指定部门数据

 * @returns
 */
export function getDepartmentsDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'

  })
}
